#!/bin/bash

#创建数据库 daekeyijiance
hive -e "set hive.exec.mode.local.auto=true;create database if not exists daekeyijiance;"

#删除原ods层交易表
hive -e "set hive.exec.mode.local.auto=true;drop table if exists daekeyijiance.asv_tb_cust_tx"

#从Oracle中重新导入新数据
sqoop import --hive-import --connect jdbc:oracle:thin:@192.168.88.1:1521/ORCL \
--username system --password 123456 --table ASV_TB_CUST_TX \
--hive-database daekeyijiance \
--hive-table asv_tb_cust_tx \
--fields-terminated-by , \
--delete-target-dir \
-m 1;

#删除原ods层客户表
hive -e "set hive.exec.mode.local.auto=true;drop table if exists daekeyijiance.asv_tb_cust_info"

#从Oracle中重新导入新数据
sqoop import --hive-import --connect jdbc:oracle:thin:@192.168.88.1:1521/ORCL \
--username system --password 123456 --table ASV_TB_CUST_INFO \
--hive-database daekeyijiance \
--hive-table asv_tb_cust_info \
--fields-terminated-by , \
--delete-target-dir \
-m 1;
